package com.snail.snailvr.model;

import com.activeandroid.Model;
import com.activeandroid.annotation.Column;
import com.activeandroid.annotation.Table;

/**
 * Created by snail on 16/4/21.
 */
@Table(name = "history")
public class History extends Model {
    @Column(name = "video_path", unique = true, onUniqueConflict = Column.ConflictAction.REPLACE)
    String path;
    @Column(name = "video_name")
    String name;

    public History() {
    }
    public History(String path,String name){
        if(path!=null) {
            if(path.startsWith("/"))
                path.replace("/","");
            else if(path.startsWith("//"))
                path.replace("//","");
            if(!path.contains("file:///"))
                this.path = "file:///" + path;
        }
        this.name=name;
    }

    public String getPath() {
        return path;
    }

    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        return "History{" +
                "path='" + path + '\'' +
                ", name='" + name + '\'' +
                '}';
    }
}
